﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Model
{
    /// <summary>
    /// 数据字典类型表
    /// </summary>
    [Table("sys_dict_type")]
    public class SysDictType
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Column("dict_id")]
        public long DictId { get; set; }

        [Required]
        [Column("dict_name")]
        [StringLength(100)]
        public string DictName { get; set; } = string.Empty;

        [Required]
        [Column("dict_type")]
        [StringLength(100)]
        public string DictType { get; set; } = string.Empty;

        [Required]
        [Column("status")]
        [StringLength(1)]
        public string Status { get; set; } = "0";

        // 移除 [Required] 或者设置默认值
        [Column("create_by")]
        [StringLength(64)]
        public string CreateBy { get; set; } = "admin"; // 设置默认值

        [Required]
        [Column("create_time")]
        public DateTime CreateTime { get; set; }

        // 移除 [Required] 或者设置默认值
        [Column("update_by")]
        [StringLength(64)]
        public string UpdateBy { get; set; } = "admin"; // 设置默认值

        [Required]
        [Column("update_time")]
        public DateTime UpdateTime { get; set; }

        [Column("remark")]
        [StringLength(500)]
        public string? Remark { get; set; }

        public virtual ICollection<SysDictData> DictDatas { get; set; } = new List<SysDictData>();
    }
}
